<template>
  <button v-bind="$attrs" :style="{fontSize:(size || 14)+'px',backgroundColor:bgColor || '#3d405b'}">
    <span>
      <slot></slot>
    </span>
  </button>
</template>

<script setup lang="ts">
  import {defineProps} from "vue"
  let props = defineProps<{
    size?:number
    bgColor?:string
  }>()
</script>

<style scoped lang="less">
button {
  display: inline-block;
  border-radius: 4px;
  border: none;
  color: #FFFFFF;
  text-align: center;
  padding: 1em;
  width: 100%;
  height: 100%;
  transition: all 0.5s;
  cursor: pointer;
  margin: 0.3125em;
}

button span {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: 0.5s;
}

button span:after {
  content: '»';
  position: absolute;
  opacity: 0;
  top: 0;
  right: -1em;
  transition: 0.5s;
}

button:hover span {
  padding-right: 1em;
}

button:hover span:after {
  opacity: 1;
  right: 0;
}
</style>